<?php

class Application_Model_DbTable_Paises extends Zend_Db_Table_Abstract
{

    protected $_name = 'paises';

	public function getPaisesList() {
		$select  = $this->_db->select()
			->from($this->_name,array('key' => 'id_pais','value' => 'nombre'));

		$result = $this->getAdapter()->fetchAll($select);

		return $result;
	}
	
	public function getPaises() {
		$select  = $this->_db->select()
			->from($this->_name);

		$result = $this->getAdapter()->fetchAll($select);

		return $result;
	}
	
	public function getPaisesFromId($idPais) {
		$select  = $this->_db->select()
			->from($this->_name)->where($this->_name.'.id_pais = ?', $idPais);
		
		$result = $this->getAdapter()->fetchAll($select);

		return $result;
	}

}

